home *** CD-ROM | disk | FTP | other *** search
- Path: news.bridge.net!news
- From: David Byrden <100101.2547@compuserve.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Random numbers
- Date: 11 Jan 1996 19:06:22 GMT
- Organization: self-employed
- Message-ID: <4d3n3e$d9m@news.bridge.net>
- References: <4cul2d$gi@news.ran.es>
- NNTP-Posting-Host: ppp-mia1-65.bridge.net
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (Windows; I; 16bit)
-
-
- Martin;
-
- The rand() function is defined to return an int. If the ints in
- your compiler are 16 bits, we can immediately say that the
- maximum number of unique random numbers available to you is
- 65536.
-
- Even if you have 32-bit random numbers, there are many different
- statistical characteristics of randomness which a particular
- rand() function may or may not support well enough. Are the numbers
- evenly distributed, do they generate equal power throughout the
- frequency spectrum, etc etc.
-
- If you need a better random number generator, or just one with more
- bits, it's time to haul out a book on numerical algorithms and write one.
- They are surprisingly small once you have themfigured out.
-
- David
-
-
-
-
-